#ifndef PARTICLE_H
#define PARTICLE_H

#include "Vec3.h"

namespace Engine
{
	class Particle
	{
		protected:
			Vec3 m_pos;
			Vec3 m_vel;
			Vec3 m_acc;
			Vec3 m_force;
			float m_inverseMass;


		public:
			void Draw();//for debugging
			void Update();

			Particle():m_inverseMass(0.0f){}
			Particle(const Vec3& pos, float inverseMass):m_pos(pos), m_inverseMass(inverseMass){}

			//getter & setter
			void SetPos(const Vec3& p) {m_pos = p;}
			void SetInverseMass(float m) {m_inverseMass = m;}
			void AddForce(const Vec3& f) {m_force += f;}

			bool HasInfiniteMass() const {return (m_inverseMass == 0.0f);}
			const Vec3& GetPos() const {return m_pos;}
			float GetInverseMass() const {return m_inverseMass;}
			float GetMass() const {return m_inverseMass > 0.0f ? 1.0f / m_inverseMass : 0.0f;}
			const Vec3& GetForce() const {return m_force;}
			const Vec3& GetVel() const {return m_vel;}
			const Vec3& GetAcc() const {return m_acc;}
	};
}

#endif